Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update NetworkConfiguration CR #623

Merged
merged 2 commits into from
Aug 10, 2024

Conversation

wenqiq
Copy link
Contributor

@wenqiq wenqiq commented Jul 1, 2024

Create VPC with new VPC API model

  1. Create a Project wenqi-test in NSX UI

  2. Create a namespace

apiVersion: v1
kind: Namespace
metadata:
  annotations:
    nsx.vmware.com/vpc_network_config: wenqi-1
  name: wenqi-1
  1. Create a VPC with a new VPC CRD yaml
apiVersion: nsx.vmware.com/v1alpha1
kind: VPCNetworkConfiguration
metadata:
  name: wenqi-1
spec:
  privateIPs: [10.30.10.0/24]
  defaultSubnetSize: 24
  vpcServiceProfile: /orgs/default/projects/wenqi-test/vpc-service-profiles/default
  nsxProject: /orgs/default/projects/wenqi-test
  vpcConnectivityProfile: /orgs/default/projects/wenqi-test/vpc-connectivity-profiles/default
  1. Check VPC resources in the NSX:
{
    "results": [
        {
            "vpc_connectivity_profile": "/orgs/default/projects/wenqi-test/vpc-connectivity-profiles/default",
            "vpc_service_profile": "/orgs/default/projects/wenqi-test/vpc-service-profiles/default",
            "load_balancer_vpc_endpoint": {
                "enabled": true
            },
            "private_ipv4_blocks": [
                "/orgs/default/projects/wenqi-test/infra/ip-blocks/e13a3582-bf1f-42ec-bc2a-f36f7e26a353_10.30.10.0"
            ],
            "ip_address_type": "IPV4",
            "short_id": "F3na1AVk",
            "resource_type": "Vpc",
            "id": "e13a3582-bf1f-42ec-bc2a-f36f7e26a353",
            "display_name": "vpc-b7b472a5-677d-4515-990f-c4bf9c1a0aa2--wenqi-1",
            "tags": [
                {
                    "scope": "nsx-op/cluster",
                    "tag": "b7b472a5-677d-4515-990f-c4bf9c1a0aa2"
                },
                {
                    "scope": "nsx-op/version",
                    "tag": "1.0.0"
                },
                {
                    "scope": "nsx-op/namespace",
                    "tag": "wenqi-1"
                },
                {
                    "scope": "nsx-op/namespace_uid",
                    "tag": "e13a3582-bf1f-42ec-bc2a-f36f7e26a353"
                }
            ],
            "path": "/orgs/default/projects/wenqi-test/vpcs/e13a3582-bf1f-42ec-bc2a-f36f7e26a353",
            "relative_path": "e13a3582-bf1f-42ec-bc2a-f36f7e26a353",
            "parent_path": "/orgs/default/projects/wenqi-test",
            "unique_id": "a0e79d9e-cbf0-4ff7-ace2-f7a813543901",
            "realization_id": "a0e79d9e-cbf0-4ff7-ace2-f7a813543901",
            "owner_id": "4447cce7-65b6-4fa0-b42c-38e9846747ac",
            "marked_for_delete": false,
            "overridden": false,
            "_system_owned": false,
            "_protection": "REQUIRE_OVERRIDE",
            "_create_time": 1721094651610,
            "_create_user": "wcp-cluster-user-b7b472a5-677d-4515-990f-c4bf9c1a0aa2-eb929be3-7d77-4b34-bf75-586933753a75",
            "_last_modified_time": 1721094652959,
            "_last_modified_user": "wcp-cluster-user-b7b472a5-677d-4515-990f-c4bf9c1a0aa2-eb929be3-7d77-4b34-bf75-586933753a75",
            "_revision": 2
        }
    ],
    "result_count": 1,
    "sort_by": "display_name",
    "sort_ascending": true
}

image

go.mod Outdated Show resolved Hide resolved
pkg/apis/v1alpha1/vpcnetworkconfiguration_types.go Outdated Show resolved Hide resolved
@wenqiq wenqiq force-pushed the topic/wenqi/upadteCRD branch 2 times, most recently from abf2b3b to e54d5ac Compare July 2, 2024 08:55
@wenqiq wenqiq marked this pull request as ready for review July 2, 2024 09:06
build/yaml/crd/nsx.vmware.com_ipaddressallocations.yaml Outdated Show resolved Hide resolved
build/yaml/crd/nsx.vmware.com_subnets.yaml Outdated Show resolved Hide resolved
pkg/nsx/services/vpc/builder.go Outdated Show resolved Hide resolved
@wenqiq
Copy link
Contributor Author

wenqiq commented Jul 5, 2024

/e2e

Makefile Outdated Show resolved Hide resolved
@wenqiq wenqiq force-pushed the topic/wenqi/upadteCRD branch 3 times, most recently from 0fe9fb3 to 3028d3b Compare July 15, 2024 03:50
@zhengxiexie
Copy link
Contributor

BTW, could you check why e2e test not pass?
Pls also attach what tests you have done in comment. Refer #626

@wenqiq
Copy link
Contributor Author

wenqiq commented Jul 15, 2024

BTW, could you check why e2e test not pass? Pls also attach what tests you have done in comment. Refer #626

As this PR uses the new VPC API and the e2e testbed uses the old NSX version, I think it’s expected that the related test cases would fail.

@wenqiq
Copy link
Contributor Author

wenqiq commented Jul 15, 2024

@lxiaopei pls help confirm some of the comments.

@wenqiq
Copy link
Contributor Author

wenqiq commented Jul 18, 2024

/e2e

@lxiaopei lxiaopei requested a review from jianjuns July 18, 2024 09:10
build/yaml/crd/nsx.vmware.com_ippools.yaml Outdated Show resolved Hide resolved
pkg/controllers/networkinfo/networkinfo_controller.go Outdated Show resolved Hide resolved
pkg/controllers/networkinfo/networkinfo_controller.go Outdated Show resolved Hide resolved
pkg/nsx/services/vpc/vpc.go Outdated Show resolved Hide resolved
@wenqiq
Copy link
Contributor Author

wenqiq commented Jul 30, 2024

/e2e

Copy link
Contributor

@dantingl dantingl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's better to go through all the codes which have ExternalIPv4Blocks and other removed parameter, to see if anything else is missing

pkg/nsx/services/vpc/vpc.go Show resolved Hide resolved
pkg/controllers/networkinfo/vpcnetworkconfig_handler.go Outdated Show resolved Hide resolved
pkg/nsx/services/vpc/compare.go Outdated Show resolved Hide resolved
@wenqiq wenqiq merged commit 23a6ad2 into vmware-tanzu:main Aug 10, 2024
2 checks passed
wenqiq added a commit to wenqiq/nsx-operator that referenced this pull request Aug 10, 2024
* Update NetworkConfiguration CR with new VPC API

---------

Signed-off-by: Wenqi Qiu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants